package leo.weixin.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

@Data
public class AccessToken {
    @JSONField(jsonDirect = true)
    private String accessToken ;
    private long expiredTime ;

    public AccessToken(String accessToken,String expireIn){
        this.accessToken = accessToken ;
        expiredTime = System.currentTimeMillis() + Integer.parseInt(expireIn) * 1000;
    }
    public boolean isExpired(){
        return System.currentTimeMillis() > expiredTime;
    }

}
